﻿@model List<LAPI.Data.Model.Reserva>
           
@{
    Int32 numeroRegistros = 0;
    if (Model != null)
    {
        numeroRegistros = Model.Count;
    }
        
    WebGrid grid = null;
    if (numeroRegistros > 0) {
        grid = new WebGrid(Model, rowsPerPage: numeroRegistros);
    } else {
        grid = null;
    }
}

<div class="row">
        @if (grid != null)
        {
            @grid.GetHtml(
            fillEmptyRows: true,
            tableStyle: "table table-striped table-bordered",
            mode: WebGridPagerModes.All,
            footerStyle: "badge",

            columns: grid.Columns(
                    grid.Column("deporte", style: "", header: "Deporte", canSort: false),                    
                    grid.Column("", style: "", header: "Fecha", canSort: false, format: 
                                @<text>  
                                <span>@item.horaInicio.ToShortDateString()&nbsp;(@item.horaInicio.ToShortTimeString() a @item.horaFinal.ToShortTimeString())</span>
                                </text> ),
                    grid.Column("luz", style: "", header: "Luz artificial", canSort: false, format: (item) => item.luz ? "Si" : "No"),
                    grid.Column("importe", style: "", header: "Importe reserva", canSort: false)                   
                        )
                )  
        }
        else
        {
            <div class="span8 offset1 label label-info">               
                No se han encontrado datos...
            </div>
        }
</div>